package com.simou.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.simou.common.BaseContext;
import com.simou.common.R;
import com.simou.entity.Orders;
import com.simou.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/order")
public class OrdersController {
    @Autowired
    OrderService orderService;

    @PostMapping("/submit")
    public R<String> addOrders(@RequestBody Orders orders){
        log.info("添加页面 orders:{}",orders);
        orderService.submit(orders);
        return R.success("添加订单成功");
    }

    @GetMapping("/page")
    public R<Page> page(){
        Orders orders = new Orders();
        return R.success(new Page<>());
    }

}
